home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / 80x0393.zip / ERROR.ASM < prev    next >
Assembly Source File  |  1993-03-30  |  2KB  |  74 lines

  1. ;
  2. ; error.asm by Rich Paul
  3. ;
  4. ; how to return an error code
  5. ; requires scroll.asm and cprint.asm
  6. ;
  7.  
  8. .model tiny
  9. .286
  10. .data
  11. extrn cprint:far
  12.  
  13. msg     db 0ffh,12,"ShiftChk V2.0 By Rich Paul",10,13
  14.         db 0ffh,14,"Released to the ",0ffh,15,"PUBLIC DOMAIN",10,13
  15.         db 0ffh,14,"Assembled with Turbo Assembler",10,13
  16.         db 0ffh,12,"Source should be included in package",10,13
  17.         db 10,13
  18.         db 0FFh,14,"Returns:",10,13
  19. msgterm db 0
  20. ret0    db 0ffh,12,"   0: No Shift Keys Pressed  ",10,13,0
  21. retsiz  equ $-ret0
  22. ret1    db 0ffh,14,"   1: Right Only             ",10,13,0
  23. ret2    db 0ffh,14,"   2: Left Only              ",10,13,0
  24. ret3    db 0ffh,14,"   3: Both Shift Keys        ",10,13,0
  25. enjoy   db 0ffh,14,"Enjoy!",10,13
  26.         db 0ffh,12,"Returning:",10,13,10
  27.  
  28. .code
  29. main proc far
  30.         mov     ax,@data
  31.         mov     ds,ax
  32.  
  33.         mov     ah,3
  34.         mov     bh,0
  35.         mov     al,3
  36.  
  37.         mov     si,offset msg
  38.         mov     dx,0ffffh
  39.         call    cprint
  40.  
  41.         mov     al,0
  42.         mov     cx,4
  43.  
  44. responceloop:
  45.         call    presp
  46.         inc     al
  47.         loop    responceloop
  48.  
  49.         mov     si,offset enjoy
  50.         call    cprint
  51.  
  52.         mov     ah,02h
  53.         int     16h
  54.  
  55.         and     al,03h
  56.         call    presp
  57.         mov     ah,4ch
  58.         int     21h
  59. main endp
  60.  
  61. presp proc near
  62.         pusha
  63.         mov     si,offset ret0
  64.         mov     bx,retsiz
  65.         xor     ah,ah
  66.         mul     bx
  67.         add     si,ax
  68.         mov     dx,0ffffh
  69.         call    cprint
  70.         popa
  71.         ret
  72. presp endp
  73. end
  74.